<link rel="stylesheet" type="text/css" href="../addons/jy_weidish/resource/css/list.css?v=1">
<style>
    .yen{border:none;height:0.75rem;width:0.75rem;display: inline-block;background: #ff4753;color:#fff;font-size:0.4rem;line-height: 0.8rem;text-align: center;
        font-style: normal;border-radius: 0.75rem;-webkit-border-radius: 0.75rem;}
    .order-create-page .fui-list.goods-item .fui-list-inner{
        height: 3.5rem;
        align-self: center;
    }
    .order-create-page .fui-list.goods-item .fui-list-angle{
        height: 3.5rem;
        align-self: center;
    }
    .order-create-page .fui-list-inner .subtitle{
        display: block;
    }
    .fui-header a.back2:before {
        content: " ";
        display: inline-block;
        -webkit-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
        transform: rotate(45deg);
        height: 0.5rem;
        width: 0.5rem;
        border-width: 0 0 2px 2px;
        border-color: #666;
        border-style: solid;
        position: relative;
        top:0;
    }
.fui-btn-c {
    height: auto;
    margin: 0;
    padding: 0.4rem;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
	justify-content:center;
    align-items: center;
    position: relative;
}

.fui-btn-c .icon {
	font-size:1rem;
	padding-right:0.3rem;
	text-align:right;
}

.fui-btn-c .info {
	text-align:left;
    padding-right: 0.2rem;
    font-size: 0.75rem;
}

.fui-btn-c .info p {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.jylabel-red-0.active::after{content:" ";width:23px;height:24px;background:url(../core/resource/images/promotion-bg.png) 0 -159px no-repeat;position:absolute;float:right;right:-1px;bottom:-1px;text-align:center;background-color:#fce9e9;}

.parent-category{float:left; width:100%; height:auto; min-height:100%;}
.parent-category ul{margin:0; padding:0; width:100%;}
.parent-category ul li{list-style:none; text-align:center; height:50px; line-height:50px; white-space:nowrap; width:100%; border-bottom:1px solid #e0e0e0; position:relative; right:-1px;}
.parent-category ul li.active{border-right:1px solid #fff; z-index: 10000}
.parent-category ul li a{color:#333; display:inline-block; width:100%; height:100%; text-decoration:none;}
.parent-category ul li.active a{color:red;}
.children-category{width:100%; min-height:100%; height:auto; color: #252525;}
.children-category ul{list-style:none; margin:0; padding:0; overflow-y:auto; overflow-x:hidden; border-left:1px solid #e0e0e0; min-height:100%;}
.children-category ul li{text-align:left; height: 32px; line-height: 32px; padding-left: 15px}
.children-category ul li.delivery-tips{height:25px; line-height:25px; margin-top: -15px; font-size: .65rem; color: #ff2d4b}
.children-category ul li a{display:inline-block; width:100%; height:100%; text-decoration:none; color:#333;}
.children-category ul li a span{font-size: .6rem; color: #999;}
.children-category .block{display:block; color:#ef1e15; font-size:.6rem;}
</style>
<div class='fui-page order-create-page'>
    <div class='fui-content'>
		<div ng-if="pagedata.sendtypes && !pagedata.sendtypeone" id="carrierTab" class="fui-tab fui-tab-danger" style="margin-bottom: 0">
            <a ng-repeat="(k,v) in pagedata.sendtypes" ng-class="{'active':pagedata.post.sendtype==k}" ng-if="pagedata.selectstore.out_juli>pagedata.selectstore.juli || !pagedata.selectstore.out_juli || pagedata.selectstore.out_juli==0 || k!=1" ng-click="pagedata.post.sendtype=k">{{v}}</a>
        </div>
		<!--地址选择-->
		<div id="addressInfo" ng-show="pagedata.post.sendtype==1" class="fui-cell-group fui-address-group" style="margin-top:0px">
			<div ng-if="pagedata.post.addressid" class="fui-cell">
				<div style="width:100%">
					<div class="fui-cell-text name bold" style="font-size:0.8rem">
						<span style="margin-right:20px">{{pagedata.item.address.name}}</span><span>{{pagedata.item.address.mobile}}</span>
					</div>
					<div class="fui-cell-text name" style="margin-top:5px">	
						<i class="fui-tag fui-tag-red">默认</i>
						<i class="fui-tag fui-tag-blue">家</i>
						{{pagedata.item.address.pcd.province+pagedata.item.address.pcd.city+pagedata.item.address.pcd.district+pagedata.item.address.address}}
					</div>
				</div>
				<div class="fui-cell-remark" ng-click="modal_func(pagedata.change_address,'','core/member.address/')" ></div>
			</div>
			<div ng-if="!pagedata.post.addressid" class="fui-cell">
				<div class="fui-list-inner" onclick="$('#modal_address').modal();">
						<div class="text no-address" ><i class="icon jinyunicon icon-tianjia"></i> {{pagedata.item.isnoarea==1?'默认地址不在配送范围,需另加':'添加收货地址'}}</div>
				</div>
			</div>
		</div>
<!--自提点选择-->
    <div ng-show="pagedata.post.sendtype==2 || pagedata.post.sendtype==3">
		<div class="fui-list-group"  id="carrierInfo" style="margin: 0 0 0.5rem">
					<a class="fui-list" href="javascript:;" onclick="$('#showstores').modal();">
						<div class="fui-list-media">
							<i class="icon icon-map"></i>
						</div>
						<div class="fui-list-inner">
							<div class="text bold">
								<span style="overflow: hidden;display: inline-block;">{{pagedata.table.id?'用餐':'取餐'}}门店：</span>
								<span class='realname'>{{pagedata.selectstore.title}} <span ng-if="pagedata.table.title">（{{pagedata.table.title}}-餐桌）</span></span>
								
							</div>
							<div class="text address">地址：<span style="color:red">{{pagedata.selectstore.pcd.city}}</span>({{pagedata.selectstore.pcd.district}} {{pagedata.selectstore.pcd.street}} {{pagedata.selectstore.address}})</div>

						</div>
						<div class="fui-list-angle">
							<div class="angle"></div>
						</div>
					</a>
		</div>
        <div class="fui-cell-group sm" id="memberInfo" ng-show="false">
                <div class="fui-cell">
                    <div class="fui-cell-label sm">联系人</div>
                    <div class="fui-cell-info c000"><input type="text" placeholder="请输入联系人" class="fui-input" ng-model="pagedata.post.realname"/></div>
                </div>
                <div class="fui-cell">
                    <div class="fui-cell-label sm">联系电话</div>
                    <div class="fui-cell-info c000"><input type="tel" placeholder="请输入联系电话"  class="fui-input" ng-model="pagedata.post.mobile"/></div>
                </div>
        </div>
	</div>
	<div class="fui-cell-group"  style="margin-top:0">
		<div class="fui-cell-title bold" style="padding: 0.5rem 0.65rem;">餐品详情</div>
		<div ng-repeat="item in pagedata.order.list" class="fui-cell">
				<div class="fui-cell-text">
					{{item.title}}<span ng-if="item.optiondata">({{item.optiondata}})</span>
				</div>
				<div class="fui-cell-remark noremark">
					 <span ng-if="item.active.title" class='red' style="font-size:0.65rem;font-weight:400"> {{item.active.title}}</span><span ng-if="!item.active.price">￥ {{item.price}}</span> <span ng-if="item.active.price" class='marketprice'>{{item.active.price}}</span><span class="subtitle" style="margin-left:0.2rem">x{{item.total}}</span>
				</div>
		</div>
		<div ng-repeat="item in pagedata.gifts" class="fui-cell">
				<div class="fui-cell-text">
					{{item.title}}<span class="fui-label fui-label-danger">赠品</span>
				</div>
				<div class="fui-cell-remark noremark">
					<span class="bold oldprice">￥ {{item.price || '0.00'}}</span> <span class="subtitle" style="margin-left:0.2rem">x1</span>
				</div>
		</div>
		<div class="fui-cell">
				<div class="fui-cell-info">
					<span class="r-f bold" style="color:#000;">共{{pagedata.order.total}}件，小计：<span class="price red">￥{{price(pagedata.order.total_price) || '0.00'}}</span></span>
				</div>
		</div>
	</div>
	<div class="fui-cell-group">
		<div class="fui-cell" ng-if="pagedata.post.invoice =='1'">
			<div class="fui-cell-label" style="width:100px">发票抬头</div>
			<div class="fui-cell-text bold r"><span style="color:red">电子</span>({{pagedata.post.invoicegoodstype !=2?'商品明细':'商品类别'}}-{{pagedata.post.fapiaotype2 !=2?'个人':'单位'}})</div>
			<div class="fui-cell-remark" onclick="$('#showfapiao').modal();" ng-click=""></div>
		</div>
		<div id='coupondiv' class="fui-cell fui-cell-click">
			<div class='fui-cell-label' style='width:auto;'>优惠券</div>
		<div class='fui-cell-text bold r'>{{pagedata.coupons[0].coupon.title5}}</div>
		<div class="fui-cell-remark" onclick="$('#showcoupon').modal();">
			<div ng-if="pagedata.coupons.length>1" class="badge">{{pagedata.coupons.length}}</div>
			<span ng-if="pagedata.coupons.length<=0" class='text'>无可用</span>
		</div>
	</div>
		<div class="fui-cell" onclick="$('#showremark').modal();">
			<div class="fui-cell-label" style="width:100px">买家留言</div>
			<div class="fui-cell-text bold r"><span ng-model="pagedata.item.remark" style="color:red">选填</span>({{pagedata.post.remark ? pagedata.post.remark :'50字以内:亲,加急哦!'}})</div>
			<div class="fui-cell-remark" ></div>
		</div>
	</div>

<div class="fui-cell-group">
	<div ng-if="pagedata.order.taskdiscountprice" class="fui-cell istaskdiscount">
        <div class="fui-cell-label" style='width:auto' >任务活动优惠</div>
        <div class="fui-cell-info"></div>
        <div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.taskdiscountprice)}}</span></div>
    </div>
    <div ng-if="pagedata.order.taskcut>0" class="fui-cell taskcut" >
        <div class="fui-cell-label" style='width:auto' >任务中心优惠</div>
        <div class="fui-cell-info"></div>
        <div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.taskcut)}}</span></div>
    </div>

    <div ng-if="pagedata.order.lotterydiscountprice>0" class="fui-cell islotterydiscount">
        <div class="fui-cell-label" style='width:auto' >游戏活动优惠</div>
        <div class="fui-cell-info"></div>
        <div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.lotterydiscountprice)}}</span></div>
    </div>

    <div ng-if="pagedata.order.level_de_price>0" class="fui-cell discount">
        <div class="fui-cell-label" style='width:auto' >会员优惠</div>
        <div class="fui-cell-info"></div>
        <div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.level_de_price)}}</span></div>
    </div>
	<div ng-if="pagedata.order.luck_de_price>0" class="fui-cell discount">
        <div class="fui-cell-label" style='width:auto' >运势优惠</div>
        <div class="fui-cell-info"></div>
        <div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.luck_de_price)}}</span></div>
    </div>
    <div ng-if="pagedata.order.isdiscountprice>0" class="fui-cell isdiscount">
        <div class="fui-cell-label" style='width:auto' >促销优惠</div>
        <div class="fui-cell-info"></div>
        <div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.isdiscountprice)}}</span></div>
    </div>

    <div ng-if="pagedata.saleset.enough.length>0" class="fui-cell" id="deductenough">
		<div class="fui-cell-label" style='width:auto' >商城优惠 <span style="font-size: .6rem">：单笔满 ￥<span id="deductenough_enough">{{pagedata.order.enough.man}}</span> 元立减￥{{pagedata.order.enough.jian}}</span></div>
		<div class="fui-cell-info"></div>
		<div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.enough.jian)}}</span></div>
	</div>

	<div ng-if="pagedata.order.sale_enough.length>0" class="fui-cell" id="merch_deductenough">
		<div class="fui-cell-label" style='width:auto' >单笔满 <span id="merch_deductenough_enough" class='text-danger'>{{pagedata.order.sale_enough[0].man}}</span> 元立减</div>
		<div class="fui-cell-info"></div>
		<div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.sale_enough[0].jian)}}</span></div>
	</div>

	<div ng-if="pagedata.order.seckillprice" class="fui-cell" id="seckillprice">
		<div class="fui-cell-label" style='width:auto' >秒杀优惠</div>
		<div class="fui-cell-info"></div>
		<div class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{price(pagedata.order.seckillprice)}}</span></div>
	</div>
	<div ng-if="pagedata.order.packageprice" class="fui-cell" id="showpackageprice">
		<div class="fui-cell-label" >套餐优惠</div>
		<div class="fui-cell-info"></div>
		<div class="fui-cell-remark noremark bold">
			&yen; <span class='packageprice'>-{{price(pagedata.order.packageprice)}}</span>
		</div>
	</div>
	<div ng-if="pagedata.post.couponid" class="fui-cell">
		<div class="fui-cell-label" style='width:auto' >{{pagedata.order.coupon.title5}}(优惠券)</div>
		<div class="fui-cell-info"></div>
		<div ng-if="pagedata.post.backtype!=1" class="fui-cell-remark noremark bold">-&yen; <span class='dispatchprice'>{{pagedata.post.deduct}}</span></div>
		<div ng-if="pagedata.post.backtype==1" class="fui-cell-remark noremark bold"><span class='dispatchprice'>{{pagedata.post.discount}}</span>折</div>
	</div>
	<div ng-if="pagedata.post.sendtype==1" class="fui-cell" id="showdispatchprice">
		<div class="fui-cell-label" style="width:200px">{{pagedata.pluginset.man_fee>0 && pagedata.order.total_price>=pagedata.pluginset.man_fee?'满'+pagedata.pluginset.man_fee+'免配送费':'配送费'}}：</div>
		<div class="fui-cell-info"></div>
		<div class="fui-cell-remark noremark bold">&yen; 
		<span ng-if="pagedata.pluginset.man_fee==0 || pagedata.order.total_price<pagedata.pluginset.man_fee" class="dispatchprice">{{price(pagedata.order.dispatchprice) || '0.00'}}</span>
		<span ng-if="pagedata.pluginset.man_fee>0 && pagedata.order.total_price>=pagedata.pluginset.man_fee" class="oldprice">{{price(pagedata.order.olddispatchprice) || '0.00'}}</span>
		</div>
	</div>
	
	<div ng-if="pagedata.post.make_type==0 && pagedata.pluginset.out_feejia" class="fui-cell">
		<div class="fui-cell-label">加急费</div>
		<div class="fui-cell-info"></div>
		<div class="fui-cell-remark noremark bold">
			&yen; <span class='dispatchprice'>{{price(pagedata.pluginset.out_feejia)}}</span>
		</div>
	</div>
</div>
<div ng-if="pagedata.post.sendtype!=1" class="fui-cell-group" style="padding:0 0.65rem;padding-bottom:1rem">
		<div class="fui-cell-title bold" style="padding: 0.5rem 0rem;">就餐方式</div>
		<div class="col-jy-2" style="padding:0">
					<a href="javascript:;" ng-click="pagedata.post.self_type=1" ng-class="{'fui-btn-c jylabel jylabel-red-0':1, 'active':pagedata.post.self_type==1}" style="border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:0.3rem;border-bottom-left-radius:0.3rem;">
						<i class="icon icon-peisong"></i>
						<div class="info"><div class="bold" style="line-height:1">店内就餐</div><div style="line-height:1">Dine IN</div></div>
					</a>
		</div>
		<div class="col-jy-2" style="padding:0">
					<a href="javascript:;" ng-click="pagedata.post.self_type=0" ng-class="{'fui-btn-c jylabel jylabel-red-0':1, 'active':pagedata.post.self_type==0}" style="border-top-right-radius:0.3rem;border-bottom-right-radius:0.3rem;border-top-left-radius:0;border-bottom-left-radius:0;">
						<i class="icon icon-gifts"></i>
						<div class="info"><div class="bold" style="line-height:1">打包带走</div><div style="line-height:1">Take Away</div></div>
					</a>
		</div>
</div>
<div ng-if="pagedata.post.sendtype==1" class="fui-cell-group" style="padding:0 0.65rem;padding-bottom:1rem">
		<div class="fui-cell-title bold" style="padding: 0.5rem 0rem;">配送时间</div>
		<div class="col-jy-2" style="padding:0">
					<a href="javascript:;" ng-click="pagedata.post.make_type=0" ng-class="{'fui-btn-c jylabel jylabel-red-0':1, 'active':pagedata.post.make_type==0}" style="border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:0.3rem;border-bottom-left-radius:0.3rem;">
						<i class="icon icon-peisong"></i>
						<div class="info"><div class="bold" style="line-height:1">{{pagedata.pluginset.on_feejia==1?'加急配送':'立即配送'}}</div><div style="line-height:1">Dine IN</div></div>
					</a>
		</div>
		<div class="col-jy-2">
					<a href="javascript:;" ng-click="pagedata.selecttime();pagedata.post.make_type=1"  ng-class="{'fui-btn-c jylabel jylabel-red-0':1, 'active':pagedata.post.make_type==1}">
						<i class="icon icon-daishouhuo1"></i>
						<div class="info"><div class="bold" style="line-height:1">预约配送</div>
							<div ng-if="!pagedata.post.out_time" style="line-height:1">Take Away</div>
							<div ng-if="pagedata.post.out_time" style="line-height:1;font-size:0.6rem">约{{pagedata.post.out_time}}送达</div>
						</div>
					</a>
		</div>
</div>
<div ng-if="pagedata.post.sendtype==3" class="fui-cell-group" style="padding:0 0.65rem;padding-bottom:1rem">
		<div class="fui-cell-title bold" style="padding: 0.5rem 0rem;">预约取餐时间</div>
		<div class="col-jy-2">
					<a href="javascript:;" ng-click="pagedata.selecttime();pagedata.post.make_type=1"  class="fui-btn-c jylabel jylabel-red-0 active">
						<i class="icon icon-daishouhuo1"></i>
						<div class="info"><div class="bold" style="line-height:1">预约取餐</div>
							<div ng-if="!pagedata.post.out_time" style="line-height:1">Take Away</div>
							<div ng-if="pagedata.post.out_time" style="line-height:1;font-size:0.6rem">约{{pagedata.post.out_time}}取餐</div>
						</div>
					</a>
		</div>
</div>
<div id="showdelivery"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0;">
		<div class="modal-bottom">
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:100px;font-size:0.9rem">配送</div>
				</div>
				<div class="fui-cell">
					<div class="tag">
						<span ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.sendtype==1}" style="margin-right:10px;" ng-click="pagedata.post.sendtype=1">快递配送</span><span ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.sendtype==2}" style="margin-right:10px;" ng-click="pagedata.post.sendtype=2">店内就餐</span>
					</div>
				</div>
			</div>
			<div ng-if="pagedata.post.sendtype !=2" class="fui-cell-group" style="margin-top:-10px">
					<div class="fui-cell">
						<div class="fui-cell-label" style="width:100px">送达时间</div>
						<div class="fui-cell-text bold r"><span style="color:red">预计</span>({{pagedata.post.deliverytime}}送达)</div>
						<div class="fui-cell-remark" onclick="$('#showsendtime').modal();" ng-click=""></div>
					</div>
			</div>
			<div ng-if="pagedata.post.sendtype ==2" class="fui-cell-group" style="margin-top:-10px">
					<div class="fui-cell">
						<div class="fui-cell-label" style="width:100px">自提地点</div>
						<div class="fui-cell-text bold r"><span style="color:red">{{pagedata.selectstore.pcd.city}}</span>({{pagedata.selectstore.pcd.district}} {{pagedata.selectstore.pcd.street}} {{pagedata.selectstore.address}})</div>
						<div class="fui-cell-remark" onclick="$('#showstores').modal();"></div>
					</div>
			</div>
			<div class="fui-navbar">
				<a aria-hidden="true" data-dismiss="modal" href="javascript:;" class="nav-item btn btn-danger confirmbtn">确定</a>
			</div>
		</div>
	</div>
</div>
<div id="showfapiao"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom">
			<div class="fui-cell-group" style="padding-bottom:2.5rem">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:100px;font-size:0.9rem">发票</div>
				</div>
				<div class="fui-cell noborder" style="">
					<div class="fui-cell-label bold" style="width:100px;font-size:0.6rem">发票类型</div>
				</div>
				<div class="fui-cell" style="margin-top:-10px">
					<div class="tag">
						<div style="width:100%">
							<span ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.invoicetype !=2}" style="margin-right:10px;" ng-click="pagedata.post.invoicetype=1">电子普通发布</span><span ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.invoicetype==2}" style="margin-right:10px;" ng-click="pagedata.post.invoicetype=2">增值税专用发票</span>
						</div>
						<div class="fui-cell-help">电子普通发票与纸质普通发票具备同等法律效力，可支持报销入账。</div>
					</div>
				</div>
				<div class="fui-cell noborder" style="">
					<div class="fui-cell-label bold" style="width:100px;font-size:0.6rem">发票抬头</div>
				</div>
				<div class="fui-cell" style="margin-top:-10px">
					<div class="tag">
						<div style="width:100%">
							<span ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.fapiaotype2 !=2}" style="margin-right:10px;" ng-click="pagedata.post.fapiaotype2=1;pagedata.post.invoicename=pagedata.item.address.name">个人</span><span ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.fapiaotype2==2}" style="margin-right:10px;" ng-click="pagedata.post.fapiaotype2=2">单位</span>
						</div>
						<div class="fui-cell-info"><input type="text" placeholder="填写抬头，姓名" class="fui-input" ng-model="pagedata.post.invoicename"/></div>
						<div class="fui-cell-info" ng-if="pagedata.post.fapiaotype2 ==2"><input type="text" placeholder="填写税号" class="fui-input" ng-model="pagedata.post.invoicecode"/></div>
					</div>
				</div>
				<div class="fui-cell noborder" style="">
					<div class="fui-cell-label bold" style="width:100px;font-size:0.6rem">收票人信息</div>
				</div>
				<div class="fui-cell sm-cell">
					<div class="fui-cell-label" style="width:80px;">收票人名称</div>
					<div class="fui-cell-info">{{pagedata.item.address.name}}</div>				
				</div>
				<div class="fui-cell sm-cell">
					<div class="fui-cell-label" style="width:80px;">收票人手机</div>
					<div class="fui-cell-info">{{pagedata.item.address.mobile}}</div>				
				</div>
				<div class="fui-cell sm-cell">
					<div class="fui-cell-label " style="width:80px;">收票人邮箱</div>
					<div class="fui-cell-info"><input type="text" placeholder="用来接收电子发票邮箱，可选填" class="fui-input" ng-model="pagedata.post.email"/></div>
				</div>
				<div class="fui-cell noborder">
					<div class="fui-cell-label bold" style="width:80px;">收票人内容</div>
					<div class="fui-cell-info">发票内容选项已根据税法调整，具体请以展示为准</div>
				</div>
				<div class="fui-cell sm-cell">
					<div class="tag">
						<div style="width:100%">
							<span ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.invoicegoodstype !=2}" style="margin-right:10px;" ng-click="pagedata.post.invoicegoodstype=1">商品明细</span><span ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.invoicegoodstype==2}" style="margin-right:10px;" ng-click="pagedata.post.invoicegoodstype=2">商品类别</span>
						</div>
						<div class="fui-cell-help" ng-if="pagedata.post.invoicegoodstype !=2">发票内容将显示详细商品名称与价格信息</div>
						<div class="fui-cell-help" ng-if="pagedata.post.invoicegoodstype ==2">发票内容将显示本商品所属类别及价格详情</div>
					</div>
				</div>
			</div>
			<div class="fui-navbar">
				<a href="javascript:;" aria-hidden="true" data-dismiss="modal" class="nav-item btn btn-danger confirmbtn">确定</a>
			</div>
		</div>
	</div>
</div>
<div id="showcoupon"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom">
			<div ng-include="sys_html('coupon/common/_picker')"></div>
		</div>
	</div>
</div>
<div id="showremark"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom">
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:100px;font-size:0.9rem">留言</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-info c000">
						<textarea rows="5" placeholder="50字以内（选填）" ng-model="pagedata.post.remark"></textarea>
					</div>
				</div>
			</div>
			<div class="fui-navbar">
				<a href="javascript:;"  aria-hidden="true" data-dismiss="modal" class="nav-item btn btn-danger confirmbtn">确定</a>
			</div>
		</div>
	</div>
</div>

<div id="modal_address"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
	<div class="modal-bottom">
		<div class='fui-page  fui-page-current'>
			<div class='fui-cell-group'>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:100px;font-size:0.9rem">添加地址</div>
				</div>
                <div class='fui-cell'>
                    <div class='fui-cell-label'>收件人</div>
                    <div class='fui-cell-info'><input type="text" ng-model="pagedata.item.address.name" placeholder="收件人" class="fui-input"/></div>
                </div>
                <div class='fui-cell'>
                    <div class='fui-cell-label'>联系电话</div>
                    <div class='fui-cell-info'><input type="tel" ng-model="pagedata.item.address.mobile" placeholder="联系电话"  class="fui-input"/></div>
                </div>

                <div class="fui-cell">
					<div class="fui-cell-label ">地区</div>
					<div class="fui-cell-label" style="width:28%">
						<select ng-model="pagedata.item.address.pcd.province" class="form-control tpl-province">
						<option value="" selected="selected">省份</option>
						<option ng-repeat="(value,data) in pagedata.province" value="{{value}}" ng-selected="pagedata.item.address.pcd.province==value">{{value}}</option>
						</select>
					</div>
					<div class="fui-cell-label" style="width:28%">
						<select ng-model="pagedata.item.address.pcd.city" class="form-control tpl-city">
						<option value="" selected="selected">城市</option>
						<option ng-repeat="(value,data) in pagedata.province[pagedata.item.address.pcd.province]" value="{{value}}" ng-selected="pagedata.item.address.pcd.city==value">{{value}}</option>
						</select>
					</div>
					<div class="fui-cell-label" style="width:28%">
						<select ng-model="pagedata.item.address.pcd.district" class="form-control tpl-district">
						<option value="" selected="selected">区县</option>
						<option ng-repeat="(value,data) in pagedata.province[pagedata.item.address.pcd.province][pagedata.item.address.pcd.city]" value="{{value}}" ng-selected="pagedata.item.address.pcd.district==value">{{value}}</option>
						</select>
					</div>
					<div class="fui-cell-label" style="width:28%">
						<select ng-model="pagedata.item.address.pcd.street" class="form-control tpl-district">
						<option value="" selected="selected">街道</option>
						<option ng-repeat="value in pagedata.province[pagedata.item.address.pcd.province][pagedata.item.address.pcd.city][pagedata.item.address.pcd.district]" value="{{value}}" ng-selected="pagedata.item.address.pcd.street==value">{{value}}</option>
						</select>
					</div>
				</div>
                <div class='fui-cell'>
                    <div class='fui-cell-label'>详细地址</div>
                    <div class='fui-cell-info'><input type="text" ng-model="pagedata.item.address.address" placeholder='街道，楼牌号等'  class="fui-input"/>
					</div>
					<div class="fui-cell-remark" ng-click="tool.choose_location(pagedata.item.address,'address','address');">点击获取</div>
                </div>
            </div>
			<div class="fui-navbar">
				<a href="javascript:;" ng-click="pagedata.add_address();" class="nav-item btn btn-danger confirmbtn">确定</a>
			</div>
		</div>
	</div>
	</div>
</div>
<div ng-if="pagedata.selectstore.out_juli==0 || pagedata.selectstore.out_juli>=pagedata.selectstore.juli || pagedata.pluginset.down_send_type3 !=1 || pagedata.pluginset.down_send_type2 !=1" class="fui-footer quick">
			<div ng-if="pagedata.post.sendtype==1" class="quick-info">
				<p style="color:#fff">￥
				<span ng-show="pagedata.post.make_type==0 && pagedata.pluginset.on_feejia==1" class="price" style="font-weight:400"> {{price(pagedata.post.endprice2) || '0.00'}}</span>
				<span ng-show="pagedata.post.make_type==1 || pagedata.pluginset.on_feejia!=1" class="price" style="font-weight:400"> {{price(pagedata.post.endprice) || '0.00'}}</span>
				</p>
			</div>
			<div ng-if="pagedata.post.sendtype!=1" class="quick-info">
				<p style="color:#fff">￥
				<span  class="price" style="font-weight:400"> {{price(pagedata.post.no_dispatch_price) || '0.00'}}</span>
				</p>
			</div>
			<div ng-if="!pagedata.order_id" class="quick-submit remark" href="javascript:;" ng-click="pagedata.pay_submit(pagedata.post,'post','/orderlist//fromcreate=1')" style="background:none;margin: 0">
				去支付
			</div>
			<div ng-if="pagedata.order_id" class="quick-submit remark" href="javascript:;" ng-click="access_json('jy_weidish/orderdetail//id='+pagedata.order_id+'&fromcreate=1')" style="background:none;margin: 0">
				查看订单
			</div>
</div>
<div ng-if="pagedata.selectstore.out_juli>0 && pagedata.selectstore.out_juli<pagedata.selectstore.juli && pagedata.pluginset.down_send_type3 ==1 && pagedata.pluginset.down_send_type2 ==1" class="fui-footer quick">
			<div class="quick-info">
				<p style="color:#fff">￥
				<span ng-show="pagedata.post.make_type==0 && pagedata.pluginset.on_feejia==1" class="price" style="font-weight:400"> {{price(pagedata.post.endprice2) || '0.00'}}</span>
				<span ng-show="pagedata.post.make_type==1 || pagedata.pluginset.on_feejia!=1" class="price" style="font-weight:400"> {{price(pagedata.post.endprice) || '0.00'}}</span>
				</p>
			</div>
			<div class="quick-submit remark disabled" style="background:none;margin: 0">
				超出配送范围
			</div>
</div>
<div id="showstoreitem"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom">
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:100px;font-size:0.9rem">{{pagedata.storeitem.title}}</div>
				</div>
				<div class="fui-cell noborder">
					<div class="fui-cell-label bold" style="width:80px;">地址：</div>
					<div class="fui-cell-info">{{pagedata.storeitem.pcd.province}} {{pagedata.storeitem.pcd.city}} {{pagedata.storeitem.pcd.district}} {{pagedata.storeitem.pcd.street}} {{pagedata.storeitem.address}}</div>
				</div>
				<div class="fui-cell noborder">
					<div class="fui-cell-label bold" style="width:80px;">联系人：</div>
					<div class="fui-cell-info">{{pagedata.storeitem.realname}}</div>
				</div>
				<div class="fui-cell noborder">
					<div class="fui-cell-label bold" style="width:80px;">联系电话：</div>
					<div class="fui-cell-info">{{pagedata.storeitem.mobile}}</div>
				</div>
			</div>
			<div class="fui-navbar">
				<a href="javascript:;"  aria-hidden="true" data-dismiss="modal" class="nav-item btn btn-danger confirmbtn">关闭</a>
			</div>
		</div>
	</div>
</div>
<div id="showstores"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom" style="padding-top:0.5rem">
			<i aria-hidden="true" data-dismiss="modal" class="closebtn icon icon-cuowu" style="top:0;right:0.1rem;color:#999;font-size:0.8rem"></i>
			<div class="fixed-title">
							 <span class="befirst spacing">
								 <span class="icon icon-icon-xiexiantiao" style="color:#efadb0"></span>
								 <span class="icon icon-icon-xiexiantiao" style="color:#e26d71"></span>
								 <span class="icon icon-icon-xiexiantiao" style="color:#d62f35"></span>
							 </span> 
							 <span class="title-text">选择门店</span> 
							 <span class="spacing">
								 <span class="icon icon-icon-xiexiantiao" style="color:#d62f35"></span>
								 <span class="icon icon-icon-xiexiantiao" style="color:#e26d71"></span>
								 <span class="icon icon-icon-xiexiantiao" style="color:#efadb0"></span>
							 </span>
			</div>
			<div class="fui-list-group merchgroup" style="margin:0 0.8rem;border-radius:0.5rem;">
				
				<div class="fui-list" ng-repeat="item in pagedata.list">
						<a class="fui-list-inner" aria-hidden="true" data-dismiss="modal" style="margin-top:0.16rem" href="javascript:;" ng-click="pagedata.selectstores($index);">
							<div class="title" style="font-size:0.76rem">{{item.title}}</div>
							<div class="subtitle">
								<i class="icon icon-map" style="color:red;font-size:0.6rem"></i> <span>{{item.address || '该门店还未填写地址'}}</span>
							</div>
							<div class="subtitle" style="font-size:0.55rem">
								<div class="store-moneylimit" ng-if="item.out_juli>=item.juli">
								  <span>¥ <span style="color:red">{{pagedata.pluginset.out_price || 10}}.00</span> 起送 </span> | 
								  <span> 配送费¥<span style="color:red"> {{item.out_pay|| pagedata.pluginset.out_fee +'.00'}}</span></span>
								  <span class="store-distance">{{item.juli || 0}}km | 约{{item.peisongtime || 50}}分钟</span>
								</div>
								<div class="store-moneylimit" ng-if="item.out_juli<item.juli">
								  <span><span style="color:#22ad0c">超出</span>配送范围</span> | 
								  <span> 配送费¥<span style="color:#22ad0c"> {{item.out_pay|| pagedata.pluginset.out_fee +'.00'}}</span></span>
								  <span class="store-distance">{{item.juli || 0}}km | 超出</span>
								</div>
							</div>
						</a>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 放弃付款-->
<div ng-if="pagedata.checkcancel" class="popup">
			<div class="popup-body">
			<div class="popup-center" style="border-radius:0.2rem;">
				<div class="fui-page-title" style="margin-top:1rem">确定要取消订单吗？</div>
				<div class="fui-page-subtitle" style="margin-top:0.1rem">喜欢的商品可能随时会被抢空哦</div>
				<div class="modal-footer" style="margin-top:2rem">
					<a ng-click="pagedata.checkcancel=false" class="mod-fail">取消</a>
					<a href="javascript:" ng-click="post({},'cancel','id='+pagedata.order.id);pagedata.checkcancel=false" class="mod-success" style="background:red">确定</a>
				</div>
			</div>
			</div>
</div>
<div id="selecttime" class="modal fade" tabindex="-1" style="z-index: 99999; display: none;">
	<div class="modal-dialog" style="width:100%;bottom:0%;left:0%;">
	<div class="modal-content" style="border-radius: 4px;">
		<div aria-hidden="true" data-dismiss="modal" class="closebtn" style="color:#ddd;top:0.2rem;right:0.2rem"><i class="icon icon-wrong" style="font-size:1.3rem;"></i></div>
		<div class="fui-line" style="width:6rem;margin:0.5rem auto 0 auto">
			<div class="text red" style="background-color:#fff" >请选择{{pagedata.post.sendtype==3?'取餐':'送达'}}时间</div>
		</div>
		<div class="row margin0">
			<div class="col-xs-3">
				<div class="parent-category" id="delivery-time-parent">
					<ul>
							<li ng-class="{'active':pagedata.post.dayid==$index}" ng-repeat="(key,value) in pagedata.out_time.days"><a href="javascript:;" ng-click="pagedata.post.dayid=$index">{{value}}</a></li>
					</ul>
				</div>
			</div>
			<div class="col-xs-9" style="padding-left:0;padding-bottom:1rem">
				<div class="children-category" id="delivery-time-children">
					<div class="children-category-wrapper">
						<ul id="category1" aria-hidden="true" data-dismiss="modal" style="height:19rem">
								<li ng-show="pagedata.out_time.lasttimebox != 0 || pagedata.post.dayid!=0" class="time-flag"><a href="javascript:;" ng-click="pagedata.post.out_time=item.predict_time">尽快{{pagedata.post.sendtype==3?'取餐':'送达'}} <span ng-if="pagedata.post.sendtype!=3">(配送费￥{{pagedata.out_time.times[0].out_pay}})</span></a></li>
								<li ng-show="pagedata.out_time.lasttimebox != 0 || pagedata.post.dayid!=0" class="delivery-tips time-flag" style="color:red">约{{pagedata.predict_time}}{{pagedata.post.sendtype==3?'取餐':'送达'}}</li>
								<li ng-repeat="item in pagedata.out_time.times" ng-click="pagedata.post.out_time=item.timev" ng-class="{'hide init-hide':(item.timestamp <= pagedata.timestamp && pagedata.post.dayid==0)}">
									<a href="javascript:;">{{item.timev}} <span ng-if="pagedata.post.sendtype!=3">({{item.out_pay}})</span></a>
								</li>
								<div class="content-empty" ng-show="pagedata.out_time.lasttimebox == 0 && pagedata.post.dayid==0">
									  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">当天没有{{pagedata.post.sendtype==3?'取餐':'配送'}}时间段！</p>
								</div>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>
</div>
<script language='javascript'>
scope.pagedata.pay_submit=function(post,post_url,complete_url){
	scope.post_json(post_url,post,function(result){
		scope.pagedata.order_id=result.order_id;
		scope.$evalAsync();
		scope.tool.pay(result.pay_id,function(res){
				if(res.type=='success'){
					scope.message(res.message,'success','/orderdetail//fromcreate=1&payid='+result.pay_id);
				}else{
					scope.message(res.message,'success','/orderdetail//fromcreate=1&payid='+result.pay_id);
				}
			});
	});
}
// 百度地图API功能
if(!scope.pagedata.lat_lng && !scope.main.lat_lng){
window.scope.location(function(res){
	scope.main.lat_lng=res.lat_lng;
	scope.main.pcd=res.addressComponents;
	scope.pagedata.item.address.pcd=scope.main.pcd;
	if(scope.pagedata.juli>0 && scope.pagedata.post.sendtype==1){
		scope.pagedata.jl(res.lat_lng);
	}
	scope.pagedata.getstores(res.lat_lng);
});
}else{
	scope.pagedata.item.address.pcd=scope.main.pcd;
	if(scope.pagedata.juli>0 && scope.pagedata.post.sendtype==1){
		scope.pagedata.jl(scope.main.lat_lng);
	}
	scope.pagedata.getstores(scope.main.lat_lng);
}
scope.pagedata.getstores=function(lat_lng){
	var id=scope.pagedata.order.list[0].id;
	scope.post_json('jy_weishop/get_data/getstores/',{'lat_lng':lat_lng,'id':id},function(res){
			scope.pagedata.stores =res.stores
			scope.pagedata.stores_count =res.stores_count
			scope.$evalAsync();
	});
}
scope.pagedata.jl=function(lat_lng){
	scope.post_json('jy_weishop/order.create/juli/',{'lat_lng':lat_lng,'juli':scope.pagedata.juli},function(res){
			if(res=='success'){
				
			}
	});
}
if(!scope.pagedata.item.address.pcd){
	window.scope.location(function(res){
				scope.pagedata.item.address.pcd={}
				scope.pagedata.item.address.pcd.province = res.addressComponents.province;
				scope.pagedata.item.address.pcd.city = res.addressComponents.city;
				scope.pagedata.item.address.pcd.district = res.addressComponents.district;
				scope.pagedata.item.address.pcd.street = res.addressComponents.street;
	});
}
scope.pagedata.add_address=function(){
	scope.pagedata.item.address.res=1
	scope.post_json('core/member.address/post/',scope.pagedata.item.address,function(res){
			console.log(res);
			scope.pagedata.post.addressid =res;
			//配送费固定
			scope.$evalAsync();
			$('#modal_address').modal('hide');
			/*scope.get('jy_weidish/create/get_freight/address='+res,function(fee){
				scope.pagedata.post.endprice=parseInt(scope.pagedata.order.endprice)-parseInt(scope.pagedata.order.dispatchprice)+parseInt(fee);
				scope.pagedata.order.dispatchprice=fee;
				scope.$evalAsync();
				$('#modal_address').modal('hide');
			});*/
	});
}
scope.pagedata.change_address=function(res){
	console.log(res);
	scope.pagedata.item.address=res;
	scope.pagedata.post.addressid=res.id;
	//配送费固定
	scope.$evalAsync();
	/*scope.get('jy_weidish/create/get_freight/address='+res,function(fee){
				
		scope.pagedata.post.endprice=parseInt(scope.pagedata.order.endprice)-parseInt(scope.pagedata.order.dispatchprice)+parseInt(fee);
		scope.pagedata.order.dispatchprice=fee;
		scope.$evalAsync();
				
	});*/
}
scope.pagedata.showstoreitem=function(){
	$('#showstoreitem').modal();
}
scope.pagedata.selectstores=function(index){
	scope.pagedata.post.store_id = scope.pagedata.list[index].id;
	scope.pagedata.selectstore=scope.pagedata.list[index]
	if(scope.pagedata.selectstore.out_juli<scope.pagedata.selectstore.juli && scope.pagedata.post.sendtype==1){
		scope.pagedata.post.sendtype=2;
	}
	$('#showstores').modal('hide');
}
// 百度地图API功能
window.scope.location(function(re){
	re.lat_lng=re.lat_lng?re.lat_lng:{};
	scope.tool.get_list('jy_weishop/store.index/getlist/limit=5&lat='+re.lat_lng.lat+'&lng='+re.lat_lng.lng,true,function(res){
		for(i=0;i<res.list.length;i++){
			if(scope.pagedata.selectstore.id==res.list[i].id){
				scope.pagedata.selectstores(i);
			}
		}
		
	});
});
scope.pagedata.checkcoupon=function(type){
	if(type){
		if(scope.pagedata.post.backtype!=1){
			scope.pagedata.post.no_dispatch_price = scope.pagedata.order.no_dispatch_price - scope.pagedata.order.coupon.deduct
			scope.pagedata.post.endprice = scope.pagedata.order.endprice - scope.pagedata.order.coupon.deduct
		}else{
			scope.pagedata.post.no_dispatch_price = scope.pagedata.order.no_dispatch_price * scope.pagedata.post.discount / 10;
			scope.pagedata.post.endprice = scope.pagedata.order.endprice * scope.pagedata.post.discount/10		
		}
	}else{
		scope.pagedata.post.couponid=0;
		if(scope.pagedata.post.backtype!=1){
			scope.pagedata.post.no_dispatch_price = scope.pagedata.order.no_dispatch_price
			scope.pagedata.post.endprice = scope.pagedata.order.endprice
		}else{
			scope.pagedata.post.no_dispatch_price = scope.pagedata.order.no_dispatch_price;
			scope.pagedata.post.endprice = scope.pagedata.order.endprice		
		}
	}
	$('#showcoupon').modal('hide');
	scope.$evalAsync();
}
scope.pagedata.selecttime=function(){
	$('#selecttime').modal();
	var store_id=scope.pagedata.post.id
	scope.get('jy_weidish/index/out_time/store_id='+store_id,function(res){
		scope.pagedata.out_time=res.out_time;
		scope.pagedata.predict_time=res.predict_time;
		scope.pagedata.timestamp=res.timestamp;
		scope.$evalAsync();
	});
}
scope.pagedata.getprovince=function(){
	scope.get('jy_weishop/get_data/getprovince/',function(res){
		scope.pagedata.province=res.province;
		scope.$evalAsync();
	});
}
scope.pagedata.getprovince();
$("input,select").blur(function(){
        setTimeout(function() {
                var scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
                window.scrollTo(0, Math.max(scrollHeight - 1, 0));
            }, 100);
})
</script>

</div>
<div ng-include="sys_html('common/_footer')"></div>